<%@ page language="java" import="java.util.*,ms.platform.system.model.*"
	pageEncoding="UTF-8"%>
	<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html>
<html lang="en">
<head>
<base href="<%=basePath%>">
<title>材料使用</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!-- 引用新样式 start -->
<jsp:include page="../../jsp/public.jsp" flush="true"/>
<!-- end -->
<script type="text/javascript">
	function queryList(){
		var modelCode = $("#modelCode").val();
		var useFor = $("#useFor").val();
		//跳转到材料使用详细页面
		window.location.href="<%=path%>/bus/meter/toMeterUseViewTwo?modelCode="+modelCode+"&useFor="+useFor;
	}
</script>
<body>
	<div class="col-lg-12">
				<div class="index-nav-right">
					<div class="index-nav-right-header"><span>当前位置 > 材料管理> <b>材料使用台账明细</b></span></div>
				</div>
				<div class="right-table">
					<form action="<%=path%>/bus/meter/toMeterUseViewTwo" id="queryForm" method="post">
						<div id="">
	                               <input hidden = "true"  type="text" name="modelCode" id="modelCode"
	                                		value="${modelCode}" /></div>

                         <div class="search-form">
                         <div class="search-form-input" style="border: 0px solid red">
								<label>用途:</label>
								<select name="useFor" id="useFor">
									<option value="" <c:if test="${useFor =='' }">selected</c:if>>请选择</option>
									<option value="取样" <c:if test="${useFor =='取样' }">selected</c:if>>取样</option>
									<option value="调试" <c:if test="${useFor =='调试' }">selected</c:if>>调试</option>
								</select>
							</div>
                         		<div class="search-form-input">
	                            </div>
                            	<div class="search-form-input">
	                            </div>
	                            <div class="search-form-input">
	                            </div>
	                            <div class="search-form-btn search-form-input">
                                <button type="submit" class="search-form-btn-s"><span >查询</span></button>
                            </div>
                         	<div class="search-form-btn search-form-input">
                                <button type="button" id="closebut" class="search-form-btn-s" ><span onClick = "close111()">返回</span></button>
                            </div>
                         </div>
                    </form>
                         <div class="index-table">
                         	<table class="table table-striped" action="<%=path%>/bus/meter/toMeterUseViewTwo">
                         		<thead>
									<tr class="table-thead">
										<th>序号</th>
										<th>部品番号</th>
										<th>用途</th>
										<th>使用日期</th>
										<th>使用数量</th>
									</tr>
								</thead>
								<tbody>
									<c:if test="${not empty list}">
										<c:forEach items="${list }" var="model" varStatus="r">
											<tr>	
												<td>${r.index+1 }</td>
												<td>${model.modelCode }</td>
												<td>${model.useFor }</td>
												<td>${model.usedTimeText }</td>
												<td>${model.usedAmount }</td>
											</tr>
										</c:forEach>
									</c:if>
									<c:if test="${empty list}">
										<tr>
											<td colspan="15"><label class="control-label text-center">无记录</label></td>
										</tr>
									</c:if>
								</tbody>
								<tr style="background: #f8f8f8">
									<td colspan="12"><jsp:include page="/WEB-INF/jsp/page2.jsp"></jsp:include></td>
								</tr>
                         	</table>
                         </div>
                     </div>
               </div>
               <input type="hidden" class="hiddenId" id ="modelPlanId" value="">
</body>
<script>
    //提交表单
    function queryMeterUsedlList(){
    	var modelCode = $("#modelCode").val();
		var useFor = $("#useFor").val();
        window.location.href="<%=path%>/bus/meter/toMeterUseViewTwo?modelCode="+modelCode+"&useFor="+useFor;
    }
    //返回上一页
    $("#closebut").click(function () {
        //history.go(-1);
        var url = "<%=path%>/bus/meter/meterGiveListTwo";
        window.location.href="<%=path%>/bus/meter/returnMeterGive?url="+url+"&flg=meterGiveListTwo";

    });

</script>
</html>